package com.mzy.datepackage.M2022.July.eleventh.common;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import java.util.Date;
import java.util.List;

@Data
public class SourceAddress {

    @ApiModelProperty(value = "资源名称，不能为空")
    private String name;

    @ApiModelProperty("选择协议：IPV4/IPV6，不能为空")
    private IpProtocol protocol;

    @ApiModelProperty("源端ip地址，不能为空")
    @Valid
    private IpParams sourceIp;

    @ApiModelProperty("端口列表")
    @Valid
    @JsonIgnore
    private List<PortParams> portParams;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "描述")
    private String desc;
}
